#!/usr/bin/env python

import hashlib


def getFarmKey(farmTime):
    #farmTime=
    #key="fs#$hsJ!Fa*AF!-0aPS"
    #key="sdoit78sdopig7w34057"
    #key="allenfengjiajialiuderrywangbillyli2012"  #2010.01.15
    #key="billyliallenfengjiajialiuderrywang0128"  #2010.01.28
    #key="@#$N*9Fi@#$JJcZXV89h012983o!$Fl12aOAISDs" #2010.02.04
    #key="@#$N*9Fi@KLJH#$dfghKLJHdfgh!$Fl12aOAISDs" #2010.03.02
    key="JomMqwdQKtL6b6gsEWAO" #2010.03.17
    pKey="97b2d!@0b8f1@&%#$xsf" #2010.03.17
    pKey="wfasdf*&#F?sd$@AFWaf" #2010.04.14
    #############key="97b2d!@0b8f1@&%#$xsf" #2010.03.26

    needMD5 = str(farmTime)+key[farmTime%10:]
    needSha1 = str(farmTime)+pKey[farmTime%10:]

    farmKey = hashlib.md5(needMD5).hexdigest()
    pastureKey = hashlib.sha1(needSha1).hexdigest()
    
    print "farmKey: %s" %farmKey
    print "pastureKey: %s" %pastureKey
    return farmKey, pastureKey

if __name__=="__main__":
    import sys
    farmTime=int(sys.argv[1])
    print "farmTime: %s"% farmTime
    #farmTime=1270859196
    getFarmKey(farmTime)
